package com.example.liuling.oscbugly280;

import android.app.AlertDialog;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;

import com.tencent.bugly.crashreport.CrashReport;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        CrashReport.initCrashReport(getApplicationContext(), "900013488", false);
        setContentView(R.layout.activity_main);

        findViewById(R.id.textview).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                showCustomDialog();
            }
        });

    }


    private void showCustomDialog() {
        AlertDialog.Builder builder;
        AlertDialog dialog;
        LayoutInflater inflator = (LayoutInflater) this.getSystemService(
                LAYOUT_INFLATER_SERVICE);
        View view = inflator.inflate(R.layout.dialoglayout, null);
        builder = new AlertDialog.Builder(getApplicationContext());
        builder.setView(view);
        dialog = builder.create();
        dialog.show();
    }

}
